import json
import pickle

train_file = '../data/train_data.pkl'
train_file_o = '../data/dataset/train.json'
test_file_o = '../data/dataset/train.json'
# train_data = pickle.load(open(train_file, 'rb'))

with open(test_file_o, 'r') as fp:
    for line in fp.readlines():
        line = json.loads(line)

        rel_s = '/people/ethnicity/geographic_distribution'
        relation_mentions = line['relationMentions']
        for rel in relation_mentions:
            if rel['label'] == rel_s:
                if(len(rel['em1Text'].split())>1):
                    print(line)